package com.zcaxer.way.books;

import java.util.ArrayList;
import java.util.List;

public class Book {
    public static final int ELEMENT_METAL = 1;
    public static final int ELEMENT_WOOD = 2;
    public static final int ELEMENT_WATER = 3;
    public static final int ELEMENT_FIRE = 4;
    public static final int ELEMENT_EARTH = 5;

    public static final int ATTR_ESOTERICA = 0;
    public static final int ATTR_DEFENCE = 1;
    public static final int ATTR_ATTACK = 2;
    public static final int ATTR_EVASION = 3;
    public static final int ATTR_SPEED = 4;
    public static final int ATTR_THUNDE_RESISTENCE = 5;
    public static final int ATTR_REIKI = 6;

    public String name;
    private int grade;
    private int effect;
    private int category;
    private int element;
    private boolean permanent;

    public Book(String name, int grade, int effect, int category, int element, boolean permanent) {
        this.name = name;
        this.grade = grade;
        this.effect = effect;
        this.category = category;
        this.element = element;
        this.permanent = permanent;
    }

    public Book(String name, int grade, int effect, int category, int element) {
        this(name, grade, effect, category, element, true);
    }

    public static List<Book> bookListSample() {
        List list = new ArrayList<>();
        list.add(new Book("无名秘诀十一卷", 10, 650, ATTR_ESOTERICA, ELEMENT_METAL));
        list.add(new Book("无名秘诀二卷", 8, 200, ATTR_ESOTERICA, ELEMENT_WOOD));
        list.add(new Book("罗刹秘诀", 6, 125, ATTR_ESOTERICA, ELEMENT_FIRE));
        list.add(new Book("七曜秘诀", 6, 125, ATTR_ESOTERICA, ELEMENT_METAL));
        list.add(new Book("阴罗秘诀", 6, 125, ATTR_ESOTERICA, ELEMENT_WATER));
        list.add(new Book("恶魔秘诀", 6, 125, ATTR_ESOTERICA, ELEMENT_WATER));
        list.add(new Book("云霄秘诀", 6, 125, ATTR_ESOTERICA, ELEMENT_FIRE));
        list.add(new Book("朝天秘诀", 6, 125, ATTR_ESOTERICA, ELEMENT_EARTH));
        list.add(new Book("问道秘诀", 6, 125, ATTR_ESOTERICA, ELEMENT_METAL));
        list.add(new Book("星月秘诀", 6, 125, ATTR_ESOTERICA, ELEMENT_FIRE));
        list.add(new Book("虹月秘诀", 6, 125, ATTR_ESOTERICA, ELEMENT_WOOD));
        list.add(new Book("无量秘诀", 6, 125, ATTR_ESOTERICA, ELEMENT_WATER));
        list.add(new Book("天师秘诀", 5, 100, ATTR_ESOTERICA, ELEMENT_WOOD));
        list.add(new Book("合欢秘诀", 5, 100, ATTR_ESOTERICA, ELEMENT_EARTH));
        list.add(new Book("碧云秘诀", 5, 100, ATTR_ESOTERICA, ELEMENT_METAL));
        list.add(new Book("天音秘诀", 4, 60, ATTR_ESOTERICA, ELEMENT_WOOD));
        list.add(new Book("紫霞功", 4, 50, ATTR_ESOTERICA, ELEMENT_WOOD));
        list.add(new Book("隐神秘诀", 4, 60, ATTR_ESOTERICA, ELEMENT_FIRE));
        list.add(new Book("九煞秘诀", 4, 60, ATTR_ESOTERICA, ELEMENT_WATER));
        list.add(new Book("青羽秘诀", 3, 30, ATTR_ESOTERICA, ELEMENT_METAL));
        list.add(new Book("天海秘诀", 2, 10, ATTR_ESOTERICA, ELEMENT_WATER));
        list.add(new Book("斗狂秘诀", 2, 10, ATTR_ESOTERICA, ELEMENT_EARTH));
        list.add(new Book("仙侣秘诀", 2, 10, ATTR_ESOTERICA, ELEMENT_FIRE));
        list.add(new Book("残阳诀", 1, 5, ATTR_ESOTERICA, ELEMENT_METAL));
        list.add(new Book("黄泉秘诀", 1, 1, ATTR_ESOTERICA, ELEMENT_WOOD));
        list.add(new Book("逍遥秘诀", 1, 1, ATTR_ESOTERICA, ELEMENT_METAL));
        return list;
    }

    public int getCategory() {
        return category;
    }

    public String getElement() {
        switch (element) {
            case ELEMENT_EARTH:
                return "土系";
            case ELEMENT_FIRE:
                return "火系";
            case ELEMENT_METAL:
                return "金系";
            case ELEMENT_WATER:
                return "水系";
            case ELEMENT_WOOD:
                return "木系";
        }
        return "系别错误";
    }

    public int getEffect() {
        return effect;
    }

    public String getName() {
        return name;
    }

    public int getGrade() {
        return grade;
    }
}

